.PHONY: all reconf upgrade

sysconf="/etc/config.scm"
machines="/etc/guix/machines.scm"
reconfopts=--max-jobs=2 --cores=2
gopts=-c1 -M1
#reconfopts="--fallback --max-jobs=2 --cores=3"
SRC="/home/ton/guixsd/src"

all: reconf

re reconf:
	sudo cp ./config.scm ${sysconf}
#	sudo cp ./machines.scm ${machines}
	sudo guix system reconfigure ${gopts} --fallback ${sysconf}

b build:
	guix system build ${gopts} --fallback ./config.scm

p pkgs:
	guix package ${gopts} --manifest=usr-pkg-manifest.scm --fallback -u
#sudo -u ton guix package --manifest=usr-pkg-manifest.scm --fallback

up upgrade pull:
	guix pull ${gopts}
#	echo "do guix pull"
#	echo "Error: NOOO: ./guix-pull-tms.fish"

#git -C ${SRC} archive --format=tar.gz --prefix=src/ v0.12.0 -o ${SRC}"/guix-latest.tar.gz"
#sudo guix pull --url=${SRC}"/guix-latest.tar.gz"

default:
`	printf "Options: [(re)conf], (up)grade\n"

